package com.lenovo.spider.process.pipeline;

import com.lenovo.spider.config.ConfigHolder;
import com.lenovo.spider.domain.ResultItem;
import lombok.extern.slf4j.Slf4j;

/**
 * @author <a href="mailto:liuhan3@lenovo.com">HanL(liuhan3)</a>
 * on 2018/3/27 15:05
 */
@Slf4j
public class ConsolePipeline extends Pipeline {

    private boolean debug;

    public ConsolePipeline() {
        this.debug = ConfigHolder.getBoolean("spider.debug");
    }

    @Override
    void pipeline(ResultItem item) {
        if (debug) return;
        log.info("结果：{}", item);
    }
}
